package com.wsdcd.zlg.sb.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class StringIsTelephone {
	public static boolean isTelephone(String string){
		Pattern pattern = Pattern.compile("^((13[0-9])|(14[0,1,4-9])|(15[0-3,5-9])|(16[2,5,6,7])|(17[0-8])|(18[0-9])|(19[0-3,5-9]))\\d{8}$");
		Matcher matcher = pattern.matcher(string);
		boolean isTelephone = matcher.matches();
		
		Pattern pattern2 = Pattern.compile("^(5|6|8|9)\\d{7}$");
		matcher = pattern2.matcher(string);
		boolean isHKTelephone = matcher.matches();
		
		return isTelephone||isHKTelephone;
	}
}
